package com.hengpeng.itfin.common;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import com.hengpeng.common.cis.ComponentContextLoader;
import com.hengpeng.common.persist.CommonDao;
import com.hengpeng.itfinbase.persist.SystemConfig;
/**
 * <pre>
 * 读取系统参数
 * </pre>
 * @author chenjian
 * @version 1.0, 2012-5-28
 */
public class SystemConfigUtil
{
	private final static Log logger = LogFactory.getLog(SystemConfigUtil.class);

	private static CommonDao commDao = ComponentContextLoader.getBean(CommonDao.class);

	public static String getConfigValue(String key)
	{
		SystemConfig sc = commDao.getEntity(SystemConfig.class, key);
		if (sc == null)
		{
			logger.error("系统参数{" + key + "}不存在!");
		}
		return sc == null ? null : sc.getValue();
	}
}
